package com.xt.wikiperfumapi.model;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import java.io.Serializable;
import lombok.Data;

/**
 * 
 * @TableName perfume_ingredient_ref
 */
@TableName(value ="perfume_ingredient_ref")
@Data
public class PerfumeIngredientRef implements Serializable {
    /**
     * 香水原料关系表
     */
    @TableId
    private Long perfumeIngredientRefId;

    /**
     * 香水id
     */
    private Long perfumeId;

    /**
     * 原料id
     */
    private Long ingredientId;

    /**
     * 是否删除
     */
    private Integer isDeleted;

    @TableField(exist = false)
    private static final long serialVersionUID = 1L;

    @Override
    public boolean equals(Object that) {
        if (this == that) {
            return true;
        }
        if (that == null) {
            return false;
        }
        if (getClass() != that.getClass()) {
            return false;
        }
        PerfumeIngredientRef other = (PerfumeIngredientRef) that;
        return (this.getPerfumeIngredientRefId() == null ? other.getPerfumeIngredientRefId() == null : this.getPerfumeIngredientRefId().equals(other.getPerfumeIngredientRefId()))
            && (this.getPerfumeId() == null ? other.getPerfumeId() == null : this.getPerfumeId().equals(other.getPerfumeId()))
            && (this.getIngredientId() == null ? other.getIngredientId() == null : this.getIngredientId().equals(other.getIngredientId()))
            && (this.getIsDeleted() == null ? other.getIsDeleted() == null : this.getIsDeleted().equals(other.getIsDeleted()));
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((getPerfumeIngredientRefId() == null) ? 0 : getPerfumeIngredientRefId().hashCode());
        result = prime * result + ((getPerfumeId() == null) ? 0 : getPerfumeId().hashCode());
        result = prime * result + ((getIngredientId() == null) ? 0 : getIngredientId().hashCode());
        result = prime * result + ((getIsDeleted() == null) ? 0 : getIsDeleted().hashCode());
        return result;
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" [");
        sb.append("Hash = ").append(hashCode());
        sb.append(", perfumeIngredientRefId=").append(perfumeIngredientRefId);
        sb.append(", perfumeId=").append(perfumeId);
        sb.append(", ingredientId=").append(ingredientId);
        sb.append(", isDeleted=").append(isDeleted);
        sb.append(", serialVersionUID=").append(serialVersionUID);
        sb.append("]");
        return sb.toString();
    }
}